﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Web;

using Amazon.Route53.DataContracts;

namespace Amazon.Route53
{
    [System.ServiceModel.ServiceContract(Namespace = Constants.Namespace)]
    public partial interface IAmazonRoute53
    {

        #region List Hosted Zones

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "hostedzone/")]
        HostedZonesList ListHostedZones();

        [OperationContract(Name = "ListHostedZonesFirstPage")]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "hostedzone/?maxitems={maxitems}")]
        HostedZonesList ListHostedZones(int maxitems);

        [OperationContract(Name = "PaginatedListHostedZones")]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "hostedzone/?marker={marker}&maxitems={maxitems}")]
        HostedZonesList ListHostedZones(string marker, int maxitems);

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "hostedzone/{HostedZoneId}")]
        HostedZoneDetail GetHostedZoneById(String HostedZoneId);

        #endregion

        #region Hosted Zone CRUD Operation
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Request"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(
            Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml, UriTemplate = "hostedzone/"
         )]
        CreateHostedZoneResponse CreateHostedZone(HostedZoneRequest Request);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="HostedZoneId"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(
            Method = "DELETE", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml, UriTemplate = "hostedzone/{HostedZoneId}"
        )]
        DeletedHostedZone DeleteHostedZone(String HostedZoneId);

        #endregion

        #region Resource Record Sets CRUD Operations

        /// <summary>
        /// 
        /// </summary>
        /// <param name="HostedZoneId"></param>
        /// <param name="Request"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(
            Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml, UriTemplate = "hostedzone/{HostedZoneId}/rrset"
        )]
        ChangeResourceRecordSetsResponse ChangeResourceRecordSets(String HostedZoneId, ResourceRecordSetsChangeRequest Request);

        [OperationContract]
        [WebGet(
            BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml, UriTemplate = "change/{ChangeId}"
        )]
        GetChangeResponse GetChange(String ChangeId);
        #endregion

        #region "List Resource Record Sets"

        /// <summary>
        /// The action retrieves a specified number of resource record sets in order, beginning at a position specified by the Name and Type elements. 
        /// The action sorts results first by DNS name (with the labels reversed, for example com.amazon.www), and second by the record type.
        /// You can use the Type element to filter the results. 
        /// </summary>
        /// <param name="HostedZoneId">The ID of the hosted zone containing the resource records sets to be retrieved.</param>
        [OperationContract(Name = "ListAllResourceRecordSets")]
        [WebInvoke(
            Method = "GET", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml, UriTemplate = "hostedzone/{HostedZoneId}/rrset"
        )]
        ListResourceRecordSetsResponse ListResourceRecordSets(String HostedZoneId);


        /// <summary>
        /// The action retrieves a specified number of resource record sets in order, beginning at a position specified by the Name and Type elements. 
        /// The action sorts results first by DNS name (with the labels reversed, for example com.amazon.www), and second by the record type.
        /// You can use the Type element to filter the results. 
        /// </summary>
        /// <param name="HostedZoneId">The ID of the hosted zone containing the resource records sets to be retrieved.</param>        
        /// <param name="name">The first name in the lexicographic ordering of domain names to be retrieved in the response to the ListResourceRecordSets request.</param>        
        [OperationContract(Name = "ListResourceRecordSetsByName")]
        [WebInvoke(
            Method = "GET"
             , BodyStyle = WebMessageBodyStyle.Bare
            , RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml
            , UriTemplate = "hostedzone/{HostedZoneId}/rrset?name={name}"
        )]
        ListResourceRecordSetsResponse ListResourceRecordSets(String HostedZoneId, string name);

        /// <summary>
        /// The action retrieves a specified number of resource record sets in order, beginning at a position specified by the Name and Type elements. 
        /// The action sorts results first by DNS name (with the labels reversed, for example com.amazon.www), and second by the record type.
        /// You can use the Type element to filter the results. 
        /// </summary>
        /// <param name="HostedZoneId">The ID of the hosted zone containing the resource records sets to be retrieved.</param>
        /// <param name="maxitems">The maximum number of records you want in the response body.(Max Value is 100)</param>
        [OperationContract(Name = "ListTopNResourceRecordSets")]
        [WebInvoke(
            Method = "GET"
             , BodyStyle = WebMessageBodyStyle.Bare
            , RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml
            , UriTemplate = "hostedzone/{HostedZoneId}/rrset?maxitems={maxitems}"
        )]
        ListResourceRecordSetsResponse ListResourceRecordSets(String HostedZoneId, int maxitems);

        /// <summary>
        /// The action retrieves a specified number of resource record sets in order, beginning at a position specified by the Name and Type elements. 
        /// The action sorts results first by DNS name (with the labels reversed, for example com.amazon.www), and second by the record type.
        /// You can use the Type element to filter the results. 
        /// </summary>
        /// <param name="HostedZoneId">The ID of the hosted zone containing the resource records sets to be retrieved.</param>
        /// <param name="dnType">The type of resource record set to begin the record listing from</param>
        /// <param name="name">The first name in the lexicographic ordering of domain names to be retrieved in the response to the ListResourceRecordSets request.</param> 
        [OperationContract(Name = "ListResourceRecordSetsByTypeAndName")]
        [WebInvoke(
            Method = "GET"
             , BodyStyle = WebMessageBodyStyle.Bare
            , RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml
            , UriTemplate = "hostedzone/{HostedZoneId}/rrset?type={dnType}&name={name}"
        )]
        ListResourceRecordSetsResponse ListResourceRecordSets(String HostedZoneId, DomainNameType dnType, string name);


        /// <summary>
        /// The action retrieves a specified number of resource record sets in order, beginning at a position specified by the Name and Type elements. 
        /// The action sorts results first by DNS name (with the labels reversed, for example com.amazon.www), and second by the record type.
        /// You can use the Type element to filter the results. 
        /// </summary>
        /// <param name="HostedZoneId">The ID of the hosted zone containing the resource records sets to be retrieved.</param>
        /// <param name="name">The first name in the lexicographic ordering of domain names to be retrieved in the response to the ListResourceRecordSets request.</param>
        /// <param name="maxitems">The maximum number of records you want in the response body.(Max Value is 100)</param>
        [OperationContract(Name = "ListTopNResourceRecordSetsByName")]
        [WebInvoke(
            Method = "GET"
             , BodyStyle = WebMessageBodyStyle.Bare
            , RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml
            , UriTemplate = "hostedzone/{HostedZoneId}/rrset?name={name}&maxitems={maxitems}"
        )]
        ListResourceRecordSetsResponse ListResourceRecordSets(String HostedZoneId, string name, int maxitems);


        /// <summary>
        /// The action retrieves a specified number of resource record sets in order, beginning at a position specified by the Name and Type elements. 
        /// The action sorts results first by DNS name (with the labels reversed, for example com.amazon.www), and second by the record type.
        /// You can use the Type element to filter the results. 
        /// </summary>
        /// <param name="HostedZoneId">The ID of the hosted zone containing the resource records sets to be retrieved.</param>
        /// <param name="dnType">The type of resource record set to begin the record listing from</param>
        /// <param name="name">The first name in the lexicographic ordering of domain names to be retrieved in the response to the ListResourceRecordSets request.</param>
        /// <param name="maxitems">The maximum number of records you want in the response body.(Max Value is 100)</param>
        [OperationContract(Name = "ListResourceRecordSets")]
        [WebInvoke(
            Method = "GET"
             , BodyStyle = WebMessageBodyStyle.Bare
            , RequestFormat = WebMessageFormat.Xml
            , ResponseFormat = WebMessageFormat.Xml
            , UriTemplate = "hostedzone/{HostedZoneId}/rrset?type={dnType}&name={name}&maxitems={maxitems}"
        )]
        ListResourceRecordSetsResponse ListResourceRecordSets(String HostedZoneId, DomainNameType dnType, string name, int maxitems);

        #endregion
    }
}